<?php
/**
  *  Project name: project_name
  *  Created on: 07.11.2011
  *  Author: Kai R�der
  *
  *  Enter description here...
  */


// Standard configuration file
include("config.inc.php");

// Check for existing user-session
if(CUserAuth::isLoggedIn()) header("LOCATION: index.php");

if(isset($_POST['submit']))
{
    if(CUserAuth::login($_POST['user'], $_POST['password']))
    {
        $_SESSION['isLoggedIn'] = true;
        header("LOCATION: index.php");
    }   
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Login</title>
<style type="text/css">
    #login {
        width: 450px;
    }
    #login-user-label {
        width: 150px;
        float: left;
    }
    #login-user-input {
        width: 300px;
        float: left;
    }
    #login-password-label {
        width: 150px;
        float: left;
    }
    #login-password-input {
        width: 300px;
        float: left;
    }
    #login-submit-input {
        width: 293px;
        text-align: right;
    }
</style>
</head>
<body>
<h1>Login</h1>
<form action="" method="POST" autocomplete="off">
    <div id="login">
        <div id="login-user-label">Benutzername:</div>
        <div id="login-user-input"><input type="text" name="user" /></div>
        <div id="login-password-label">Passwort:</div>
        <div id="login-password-input"><input type="password" name="password" /></div>
        <div id="login-submit-input"><input type="submit" name="submit" value="Anmelden" /></div>
    </div>
</form>

</body>
</html>